from utils import get_mongo_collection
from bilibili_update import  get_tag


def main():
    for i in get_mongo_collection('bilibili_submitvideo_list').find({'tags':None}):

        # print(i['aid'])
        get_mongo_collection('bilibili_submitvideo_list').update_many({"aid": i['aid']}, {"$set": {'tags': get_tag(i['aid'])}})

if __name__ == '__main__':
    main()
